<?php


namespace app\blog\controller\v1;


use app\BaseController;
use app\blog\model\ShareUrlModel;

class ShareUrl extends BaseController
{
    /**
     * 博客获取友情链接
     * @return \think\response\Json
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public function getShareUrl() {
        $model = new ShareUrlModel();
        $result = $model->where('status', '=', 1)
            ->order('px', 'desc')
            ->hidden(['add_time', 'status', 'px', 'update_time'])
            ->select();
        if ($result) {
            return successJson($result, "获取成功");
        }
        return errorJson(6001, "获取失败");
    }
}